using BikyBall.Game;
using BikyBall.Input;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BikyBall.Object
{
    public class Camera : GameObject
    {
        public GameObject Target;

        public void Update(InputEngine inputEngine)
        {
            /*this.GetProperties<GameProperty>().Position = this.Target.GetProperties<GameProperty>().Position;
            this.GetProperties<GameProperty>().Position.Z = this.Target.GetProperties<GameProperty>().Position.Z + 5.0f * inputEngine.PinchDelta;
            this.GetProperties<GameProperty>().Position.Y = this.Target.GetProperties<GameProperty>().Position.Y + 5.0f * inputEngine.PinchDelta;*/

            this.GetProperties<GameProperty>().Position.X = (this.GetProperties<GameProperty>().Position.X * 2 + this.Target.GetProperties<GameProperty>().Position.X) / 3.0f;
            this.GetProperties<GameProperty>().Position.Z = ((this.GetProperties<GameProperty>().Position.Z * 2 + this.Target.GetProperties<GameProperty>().Position.Z) / 3.0f) + 2.0f * inputEngine.PinchDelta;
            this.GetProperties<GameProperty>().Position.Y = this.Target.GetProperties<GameProperty>().Position.Y + 5.0f * inputEngine.PinchDelta;
        }
    }
}
